import matplotlib
import numpy as np
import matplotlib.cm as cm
import matplotlib.pyplot as plt

def f(x, y):
    return (1 - x) ** 2 + 100 * (y - x * x) ** 2



begin=-4
end=-begin
n=256
x = np.linspace(-1, 1.1, n)
y = np.linspace(-0.1, 1.1, n)
X, Y = np.meshgrid(x, y)
Z = f(X,Y)

fig, ax = plt.subplots()
CS = ax.contour(X, Y, Z)
ax.clabel(CS, inline=True, fontsize=10)
ax.set_title('Simplest default with labels')

plt.show()